home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* MSSetup Yellow Pages Setup
- '**************************************************************************
-
- '$DEFINE DEBUG ''Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- CONST SW_SHOWMAXIMIZED = 3
- DECLARE FUNCTION ShowWindow LIB "user" (hWnd%, nCmdShow%) AS INTEGER
-
- ''Dialog ID's
- CONST WELCOME = 100
- CONST EXITSUCCESS = 200
- CONST DESTPATH = 300
- CONST ASKQUIT = 500
- CONST NOACROBAT = 1400
- CONST EXITFAILURE = 2100
- CONST EXITQUIT = 2200
- CONST APPHELP = 2600
- CONST BILL1 = 5000
- CONST BILL2 = 5010
- CONST BILL3 = 5020
-
-
- ''Bitmap ID
- CONST LOGO = 1
-
-
- GLOBAL DEST$ ''Default destination directory.
-
-
- DECLARE SUB Install
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
-
- INIT:
- CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
- HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
-
- SetBitmap CUIDLL$, LOGO
- SetTitle "Luckman Interactive - Net Commander Manual Setup"
-
- '' maximize the window
- hwndSetup% = HwndFrame()
- nRet% = ShowWindow (hwndSetup%, SW_SHOWMAXIMIZED)
-
- '' put the gauge in the lower right corner
- SetCopyGaugePosition 160, 170
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "MANUAL.INF"
- END IF
- '' ReadInfFile szInf$
-
-
- WELCOME:
- winDir$ = GetWindowsDir() + "WIN.INI"
- tempPath$ = GetIniKeyString(winDir$, "Extensions", "PDF")
-
- found% = 0
- IF tempPath$ = "" OR LEN(tempPath$) = 0 THEN
- dlg% = NOACROBAT
- GOTO QUITL1
- ELSE
- i% = 1
- j% = LEN(tempPath$)
- WHILE (i% <= j%) AND (found = 0)
- ch$ = MID$(tempPath$,i%,1)
- IF ch$ = " " THEN
- found% = 1
- ENDIF
- i% = i% +1
- WEND
- ENDIF
-
- IF found% = 1 THEN
- acrobatPath$ = MID$(tempPath$,1,i%-1 )
- ELSE
- dlg% = NOACROBAT
- GOTO QUITL1
- ENDIF
-
- CreateProgmanItem "Net Commander", "Net Commander Manual", acrobatPath$ + " " + SrcDir$ + "manual.pdf", szTemp$, cmoOverwrite
-
-
-
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- dlg% = EXITSUCCESS
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, contact Luckman Interactive!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
-
- BADPATH:
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
-
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
-
-
- '**
- '** Purpose:
- '** Builds the copy list and performs all installation operations.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB Install STATIC
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- CreateDir DEST$, cmoNone
-
- OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
- WriteToLogFile ""
- WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
- WriteToLogFile ""
- WriteToLogFile "May have had to create the directory: " + DEST$
- WriteToLogFile ""
-
- DESTHTM$ = MakePath(DEST$, "YP")
- CreateDir DESTHTM$, cmoNone
- AddSectionFilesToCopyList "htm", SrcDir$, DESTHTM$
-
- DESTGIF$ = MakePath(DEST$, "YP\GIFS")
- CreateDir DESTGIF$, cmoNone
- AddSectionFilesToCopyList "gif", SrcDir$, DESTGIF$
-
- CopyFilesInCopyList
- WriteToLogFile "Copied Yellow Pages Files"
-
- '' Update SMOSAIC.INI (remove the / at the end)
- SystemIniPath$ = GetWindowsDir()
- IF DoesFileExist( SystemIniPath$ + "SMOSAIC.INI", femExists ) THEN
- CreateIniKeyValue SystemIniPath$ + "SMOSAIC.INI", "Installation", "YPPath", DESTHTM$, cmoOverwrite
- CreateIniKeyValue SystemIniPath$ + "SMOSAIC.INI", "Installation", "YPVersion", "1.0", cmoOverwrite
- END IF
-
- CloseLogFile
-
- END SUB
-
-
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
-